package com.valuegroup.smarttodo.ui.todo.task.qucikadd;

import com.valuegroup.smarttodo.R;

import java.io.Serializable;

/**
 * 创建日期：2017/9/14.
 *
 * @author kevin
 */

public class QuickAddHolder implements Serializable {

    int layoutResId;
    int cancelViewId;
    int submitViewId;
    int editTextId;
    int noContentBtn;
    int hintStrId;
    int finishBtnId;

    public QuickAddHolder(QuickAddType type) {
        hintStrId = 0;
        switch (type) {
            case TASK:
                layoutResId = R.layout.quickadd_insert;
                cancelViewId = 0;
                submitViewId = R.id.quick_add_task_submit_btn;
                noContentBtn = R.id.quick_add_task_close_btn;
                editTextId = R.id.quick_add_task_content_edt;
                break;
            case EVENT_INSERT:
                layoutResId = R.layout.quickadd_insert;
                cancelViewId = 0;
                submitViewId = R.id.quick_add_task_submit_btn;
                noContentBtn = R.id.quick_add_task_close_btn;
                editTextId = R.id.quick_add_task_content_edt;
                hintStrId = R.string.quickly_add_event;
                break;
            case HABIT_SIGNING:
                layoutResId = R.layout.quickadd_insert;
                cancelViewId = 0;
                submitViewId = R.id.quick_add_task_submit_btn;
                noContentBtn = R.id.quick_add_task_close_btn;
                editTextId = R.id.quick_add_task_content_edt;
                hintStrId = R.string.add_remark;
                break;
            case EVENT_UPDATE:
                layoutResId = R.layout.quickadd_update;
                cancelViewId = 0;
                submitViewId = R.id.quick_add_task_submit_btn;
                noContentBtn = R.id.quick_add_task_close_btn;
                editTextId = R.id.quick_add_task_content_edt;
                hintStrId = R.string.quickly_add_event;
                finishBtnId = R.id.btnFinish;
                break;
            case RETHINK:
                layoutResId = R.layout.quickadd_insert;
                cancelViewId = 0;
                submitViewId = R.id.quick_add_task_submit_btn;
                noContentBtn = R.id.quick_add_task_close_btn;
                editTextId = R.id.quick_add_task_content_edt;
                hintStrId = R.string.quickly_add_rethink;
                break;
            case MULTI_INSERT_FOR_RETHINK:
                layoutResId = R.layout.quickadd_multi_insert;
                cancelViewId = 0;
                submitViewId = R.id.quick_add_task_submit_btn;
                noContentBtn = R.id.quick_add_task_close_btn;
                editTextId = R.id.quick_add_task_content_edt;
                hintStrId = R.string.multi_insert_for_rethink;
                break;
            case MULTI_INSERT_FOR_STUDY:
            case MULTI_INSERT_FOR_GOALS:
                layoutResId = R.layout.quickadd_multi_insert;
                cancelViewId = 0;
                submitViewId = R.id.quick_add_task_submit_btn;
                noContentBtn = R.id.quick_add_task_close_btn;
                editTextId = R.id.quick_add_task_content_edt;
                hintStrId = R.string.multi_insert_for_study;
                break;
            case MULTI_INSERT_FOR_SUM:
                layoutResId = R.layout.quickadd_multi_insert;
                cancelViewId = 0;
                submitViewId = R.id.quick_add_task_submit_btn;
                noContentBtn = R.id.quick_add_task_close_btn;
                editTextId = R.id.quick_add_task_content_edt;
                hintStrId = R.string.multi_insert_for_sum;
                break;
            case DEFAULT:
                layoutResId = R.layout.quickadd_default;
                cancelViewId = R.id.quick_add_default_cancel_tv;
                submitViewId = R.id.quick_add_default_send_tv;
                noContentBtn = 0;
                editTextId = R.id.quick_add_default_content_edt;
                break;
        }
    }

    public enum QuickAddType {
        TASK,
        EVENT_INSERT,
        EVENT_UPDATE,
        HABIT_SIGNING,
        RETHINK,
        MULTI_INSERT_FOR_RETHINK,
        MULTI_INSERT_FOR_STUDY,
        MULTI_INSERT_FOR_GOALS,
        MULTI_INSERT_FOR_SUM,
        DEFAULT
    }
}
